﻿<%@ Page Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="Create.aspx.cs" Inherits="Users_Create" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="phHead" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phSubMenu" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="phActions" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="phMain" Runat="Server">
    <p id="duplicateUserNameErrorMessage" class="error" visible="false" runat="server">Username already exists.</p>
    <p id="duplicateEmailErrorMessage" class="error" visible="false" runat="server">Email address already exists.</p>
    <asp:FormView id="fvUser" DefaultMode="Insert" DataSourceID="dsUser" DataKeyNames="Id,ConcurencyId" runat="server">
        <InsertItemTemplate>
            <div style="float:left;width:49.5%">
                <span class="AspNet-DetailsView-Name">User Name*</span>
                <span class="AspNet-DetailsView-Value">
                    <asp:TextBox ID="txtUserName" Text='<%# Bind("UserName") %>' runat="server"/>
                    <asp:RequiredFieldValidator ID="valUserNameReq" ControlToValidate="txtUserName" ErrorMessage="Required" Display="Dynamic" runat="server" />
                    <asp:CustomValidator ID="valUserNameUnique" ControlToValidate="txtUserName" ErrorMessage="Username already exists" Display="Dynamic" runat="server" OnServerValidate="valUserNameUnique_Validate" />
                </span>
                <span class="AspNet-DetailsView-Name">First Name*</span>
                <span class="AspNet-DetailsView-Value">
                    <asp:TextBox ID="txtFristName" Text='<%# Bind("FirstName") %>' runat="server"/>
                    <asp:RequiredFieldValidator ID="valFirstNameReq" ControlToValidate="txtFristName" ErrorMessage="Required" Display="Dynamic" runat="server" />
                </span>
                <span class="AspNet-DetailsView-Name">Last Name*</span>
                <span class="AspNet-DetailsView-Value">
                    <asp:TextBox ID="txtLastName" Text='<%# Bind("LastName") %>' runat="server"/>
                    <asp:RequiredFieldValidator ID="valLastNameReq" ControlToValidate="txtLastName" ErrorMessage="Required" Display="Dynamic" runat="server" />
                </span>
                <span class="AspNet-DetailsView-Name">Email Address*</span>
                <span class="AspNet-DetailsView-Value">
                    <asp:TextBox ID="txtEmailAddress" Text='<%# Bind("EmailAddress") %>' runat="server"/>
                    <asp:RequiredFieldValidator ID="valEmailAddressReq" ControlToValidate="txtEmailAddress" ErrorMessage="Required" Display="Dynamic" runat="server" />
                    <asp:CustomValidator ID="valEmailUnique" ControlToValidate="txtEmailAddress" ErrorMessage="Email already exists" Display="Dynamic" runat="server" OnServerValidate="valEmailUnique_Validate" />
                </span>
                <span class="AspNet-DetailsView-Name">Confirm Email Address*</span>
                <span class="AspNet-DetailsView-Value">
                    <asp:TextBox ID="txtConfirmEmailAddress" runat="server"/>
                    <asp:RequiredFieldValidator ID="valConfirmEmailAddressReq" ControlToValidate="txtConfirmEmailAddress" ErrorMessage="Required" Display="Dynamic" runat="server" />
                    <asp:CompareValidator ID="valConfirmEmailAddressMatch" ControlToCompare="txtEmailAddress" ControlToValidate="txtConfirmEmailAddress" ErrorMessage="Emails do not match" Display="Dynamic" runat="server" />
                </span>
            </div>
            <div style="float:right;width:49.5%">
                <span class="AspNet-DetailsView-Name">Roles</span>
                <asp:CheckBoxList ID="cblRoles" DataSourceID="dsRoles" DataTextField="Name" DataValueField="ID" runat="server">
                </asp:CheckBoxList>
                <div class="buttons">
                    <asp:Button ID="btnCommit" CommandName="Insert" Text="Create" runat="server" />
                </span>
            </div>
        </InsertItemTemplate>
    </asp:FormView>
    <acms:UserDataSource ID="dsUser" runat="server" EnablePaging="False" OnSelectData="dsUser_SelectData" OnUpdateData="dsUser_UpdateData">
    </acms:UserDataSource>
    <acms:RolesDataSource ID="dsRoles" runat="server" OnSelectData="dsRoles_SelectData" />
</asp:Content>

